This document provides instructions for downloading and installing R and RStudio on an Apple Macintosh machine.

Before you start

  1. Check which version of Mac OS you have. To do this, click on the Apple icon on the top-left of your screen, then click “About This Mac”. A little window should pop up with version information.


2. Make sure that you have about 500 MB of free space on your machine. We will need this space to install both R and RStudio, and when the program installs the compressed files expand to take much more space.

Installing R

  1. Go to this website.

  2. If your mac is OS X 10.11 and higher (this should be the case for most of you), click the R-3.5.1.pkg link. If your mac is OS X 10.9 or 10.10, click the R-3.3.3.pkg link.

  3. After clicking on the link, the file (package installer) will be downloaded onto your computer. Once the file has been downloaded, click on the link and walk through the installation process. Accept the default options for now.

R is now installed on your computer.

Testing R

  1. Double-click on the R icon in the Applications folder. A window titled “R Console” should pop up:


The > character is called the prompt and is the place where we enter commands for the program to interpret. For instance, if you type 25+26 followed by the return/enter key, you will see:

25+26
## [1] 51
  1. To quit R, call the quit function by typing q() and htting the return key.
q()

R will ask you if you want to save your work:


Click on “Don’t Save”. You have now left R.

We are not going to use R this way often, as we will use an integrated environment called RStudio.

Installing RStudio

  1. Go to this website.

  2. Click on the “RStudio 1.1.456 - Mac OS X 10.6+ (64-bit)” link. The file download will begin.

  3. Once the file has been downloaded, click on it. A window should pop up:


Click on the RStudio icon and drag it into the Applications folder.

RStudio is now installed on your computer.

Note: For RStudio to work, R needs to be installed first.

Testing RStudio

  1. Double-click on the RStudio icon in the Applications. A window titled “RStudio” should pop up, looking something like this:

 

  1. Just as in R, the > character in the Console window is where we enter commands for the program to interpret.

  2. To exit RStudio, click “RStudio” in the menu bar, then click “Quit RStudio”. Alternatively, use the Cmd-Q shortcut. If prompted to save the workspace, do not save it.